<layout name="layout"/>

<div class="form-div">
    <form action="__ACTION__" method="get" name="searchForm">
        <img src="__PUBLIC__/Admin/Images/icon_search.gif" width="26" height="22" border="0" alt="search" />

        <!-- 分类 -->
        <p>商品分类：<select name="cat_id">
            <option value="">主分类</option>
            <?php foreach($catData as $k => $v): ?>
            <option value="<?php echo $v['id']; ?>">
                <?php echo str_repeat('-',8*$v['level']).$v['cat_name']; ?>
            </option>
            <?php endforeach;?>
        </select></p>
        <p>商品品牌：<select name="brand_id">
            <option value="">请选择</option>
            <?php foreach ($brandData as $k => $v){ ?>
            <option value="<?php echo $v['id'];?>"><?php echo $v['brand_name'];?></option>
            <?php }?>
        </select></p>
        <p>
            商品名称：<input value="<?php echo I('get.gn');?>" type="text" name="gn" size="60"/>
        </p>
        <p>
            价  格：
            从 <input value="<?php echo I('get.fp');?>" type="text" name="fp" size="8"/>
            到 <input value="<?php echo I('get.np');?>" type="text" name="np" size="8"/>
        </p>
        <p>
            是否上架：<?php $ios = I('get.ios'); ?>
            <input type="radio" name="ios" size="8" value=""<?php if($ios == '')echo 'checked = "checked"'; ?> /> 全部
            <input type="radio" name="ios" size="8" value="是"<?php if($ios == '是')echo 'checked = "checked"'; ?> /> 上架
            <input type="radio" name="ios" size="8" value="否"<?php if($ios == '否')echo 'checked = "checked"'; ?> /> 下架
        </p>
        <p>
            添加时间：
             从 <input  type="text" id="fa" name="fa" size="20" value="<?php echo I('get.fa')?>"/>
            到 <input  type="text" id="ta" name="ta" size="20" value="<?php echo I('get.ta')?>"/>
        </p>
        <p>
            排序方式：
            <?php $odby = I('get.odby','id_desc')?>
            <input onclick="this.parentNode.parentNode.submit()" type="radio" name="odby" value="id_desc"<?php if($odby == 'id_desc')echo 'checked = "checked"'; ?>/>以添加先后降序
            <input onclick="this.parentNode.parentNode.submit()" type="radio" name="odby" value="id_asc"<?php if($odby == 'id_asc')echo 'checked = "checked"'; ?>/>以添加先后升序
            <input onclick="this.parentNode.parentNode.submit()" type="radio" name="odby" value="price_desc"<?php if($odby == 'price_desc')echo 'checked = "checked"'; ?>/>以添加时间降序
            <input onclick="this.parentNode.parentNode.submit()" type="radio" name="odby" value="price_asc"<?php if($odby == 'price_asc')echo 'checked = "checked"'; ?>/>以添加时间升序
        </p>
        <!-- 关键字 -->
        关键字：<input type="text" name="keyword" size="15" />
        <input type="submit" value=" 搜索 " class="button" />
    </form>
</div>

<!-- 商品列表 -->
<form method="post" action="" name="listForm" onsubmit="">
    <div class="list-div" id="listDiv">
        <table cellpadding="3" cellspacing="1">
            <tr>
                <th>编号</th>
                <th>主分类</th>
                <th>拓展分类</th>
                <th>商品品牌</th>
                <th>商品名称</th>
                <th>货号</th>
                <th>价格</th>
                <th>上架</th>
                <th>LOGO</th>
                <th>商品说明</th>
                <th>推荐排序</th>
                <th>库存</th>
                <th>操作</th>
            </tr>
            <foreach name="data['data']" item="val" key="key">
                <tr>
                    <td align="center">{$val.id}</td>
                    <td align="center">{$val.cat_name}</td>
                    <td>{$val.ext_cat_name}</td>
                    <td align="center"><span value="{$val.id}">{$val.brand_name}</span></td>
                    <td align="center" class="first-cell"><span>{$val.goods_name}</span></td>
                    <td align="center"><span onclick="">{$val.goods_sn}</span></td>
                    <td align="center"><span>{$val.shop_price}</span></td>
                    <td align="center"><img src="<if condition='($val.is_on_sale eq "是")'> __PUBLIC__/Admin/Images/yes.gif <else/> __PUBLIC__/Admin/Images/no.gif </if>"/></td>
                    <td align="center"><img src="__PUBLIC__/uploads/{$val.sm_logo}"/></td>
                    <td align="center">{$val.goods_desc|html_entity_decode}</td>
                    <td align="center"><span>100</span></td>
                    <td align="center"><span>{$val.goods_number}</span></td>
                    <td align="center">
                        <a href="<?php echo U('goods_number?id='.$v['id']); ?>">库存量</a>
                        <a href="<?php echo U('edit?id='.$v['id']); ?>">修改</a>
                        <a onclick="return confirm('确定要删除吗？');" href="<?php echo U('delete?id='.$v['id']); ?>">删除</a>
                    </td>
                    <!--<td align="center">
                        <a href="<?php echo U('goods_number?id='.$val['id']); ?>" title="库存量">
                            <img src="__PUBLIC__/Admin/Images/icon_view.gif" width="16" height="16" border="0" /></a>
                        <a href="<?php echo U('edit?id='.$val['id']); ?>" title="编辑">
                            <img src="__PUBLIC__/Admin/Images/icon_edit.gif" width="16" height="16" border="0" /></a>
                        <a href="<?php echo U('del?id='.$val['id']); ?>" title="回收站">
                            <img src="__PUBLIC__/Admin/Images/icon_trash.gif" width="16" height="16" border="0" /></a>
                    </td>-->
                </tr>
            </foreach>
        </table>

        <!-- 分页开始 -->
        <table id="page-table" cellspacing="0">
            <tr>
                <td width="80%">&nbsp;</td>
                <td align="center" nowrap="true">
                    {$data['page']}
                </td>
            </tr>
        </table>
        <!-- 分页结束 -->
    </div>
</form>

<div id="footer">
    共执行 7 个查询，用时 0.028849 秒，Gzip 已禁用，内存占用 3.219 MB<br />
    版权所有 &copy; 2005-2012 上海商派网络科技有限公司，并保留所有权利。</div>

<!--引入时间插件-->
<link href="__PUBLIC__/datetimepicker/jquery-ui-1.9.2.custom.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/datetimepicker/jquery-ui-1.9.2.custom.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/datetimepicker/datepicker-zh_cn.js"></script>
<link rel="stylesheet" media="all" type="text/css" href="__PUBLIC__/datetimepicker/time/jquery-ui-timepicker-addon.min.css" />
<script type="text/javascript" src="__PUBLIC__/datetimepicker/time/jquery-ui-timepicker-addon.min.js"></script>
<script>
    $.timepicker.setDefaults($.timepicker.regional['zh-CN']);
    $("#fa").datetimepicker();
    $("#ta").datetimepicker();
</script>
</body>
</html>